import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";
// use 开票查询列表
export function invoiceList(params: any) {
  return http.request("get", baseUrlApi("business/invoice_order/listTax"), {
    params
  });
}
// use 开票状态
export function invoiceOrderState() {
  return http.request("get", baseUrlApi("constantList/invoiceOrderState"));
}

// use开票查看详情
export function getInvoiceInfoDetail(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/invoice_order/getInvoiceById"),
    { params }
  );
}
// 开票管理 [查询]列表
export function queryInvoiceListTax(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/merchants_info_invoice/listTax"),
    { params }
  );
}

// use开票管理 开票 编辑
export function handleEditInvoiceOrderInfo(params: any) {
  return http.request(
    "put",
    baseUrlApi("business/merchants_info_invoice/edit"),
    { data: params }
  );
}
// 开票管理  [开票]列表
export function querylistBackstageTax(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/invoice_order/listBackstageTax"),
    { params }
  );
}
// use开票管理 [开票] 查看
export const getInvoiceOrderInfo = (id: number | string) => {
  return http.request(
    "get",
    baseUrlApi(`business/invoice_order/getInfo/${id}`)
  );
};
// use开票管理  开票列表 查看
export function handleViewInvoiceInfo(params: any) {
  return http.request("get", baseUrlApi("business/invoice_order/getInfo"), {
    params
  });
}
// use开票 作废
export function auditBackstage(params: any) {
  return http.request(
    "put",
    baseUrlApi("business/invoice_order/auditBackstage"),
    {
      data: params
    }
  );
}
// use 上传发票
export function uploadTheInvoice(params: any) {
  return http.request(
    "put",
    baseUrlApi("business/invoice_order/uploadTheInvoice"),
    {
      data: params
    }
  );
}
